<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <!--首页css-->

    <link rel="stylesheet" href="../../static/css/login.css" />
    <script type="text/javascript" src="../../static/js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../../static/js/jquery.cookie.min.js"></script>
    <title>忘记密码</title>
</head>
<body>
<div class="logo"></div>
<span class="text">慧上云</span>

<div style="position: absolute;z-index: 103;right:15px;top:30px;width:150px;height:45px;line-height: 45px;text-align: center;cursor: pointer">
    <a href="login.html"><div class="btn" style="width: 150px;background: rgba(72, 180, 209,0.4);">登录</div></a>
</div>

<div style="position: absolute;z-index: 100;width:100%;height:100%;background-image: url('../../static/images/loginbg.jpg');background-size: 100%;"></div>
<div style="position: absolute;z-index: 101;width:100%;height:100%;background: #007ACA;filter:alpha(Opacity=40);-moz-opacity:0.4;opacity: 0.4;"></div>
<div style="position: absolute;z-index: 102;width:100%;height:100%;background: none;margin:0 auto;">
    <div class="login" style="margin-top: 100px;">
        <div class="line" style="font-size: 26px;color:#fff;font-weight: 700;">
            忘记密码
        </div>
        <div class="line" style="">
            <input class="input" id="phone" type="text" placeholder="手机号" autocomplete="off"/>
        </div>
        <div class="line" style="position: relative;">
            <input class="input" id="code" type="text" placeholder="验证码" autocomplete="off"/>

            <a href="javascript:;" send="0" id="sendCode" style="position: absolute;    right: 80px;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;    top: 27px;">发送验证码</a>
        </div>
        <div class="line" style="">
            <input class="input" id="password" type="password" placeholder="请输入密码"  autocomplete="off"/>
        </div>
        <div class="line" style="">
            <div class="btn" id="reg">重置密码</div>
        </div>
    </div>
</div>

<script type="text/javascript">
    var number = 60,intervalId;
	$(function () {
        $('.logo').click(toHome);
        $('.text').click(toHome);

        $('#sendCode').click(function () {
            var send = $('#sendCode').attr('send');
            if( send==1 ){
                return;
            }
            $('#sendCode').attr("send","1");
            $.ajax({
                url:'/hrms/platform/code',
                data:{phone:$('#phone').val()},
                dataType:'JSON',
                success:function (resp) {
                    $('#code').focus();
                    $('#sendCode').html('60秒后重新获取');
                    intervalId = setInterval("setSendCodeMill()",1000);
                }
            });
        });



        $('#reg').click(function () {
            $.ajax({
                url:'/hrms/platform/reg',
                data:{phone:$('#phone').val(),code:$('#codetext').val()},
                dataType:'JSON',
                success:function (resp) {
                    $('#codetext').focus();
                }
            });
        });
    });

    function toHome() {
        top.location.href = "../../portal/portal.html";
    }

    function setSendCodeMill(){
        number--;
        if( number < 0 )return;
        $('#sendCode').html(number+'秒后重新获取');
        if( number <= 0 ){
            clearInterval(intervalId);
            $('#sendCode').attr("send","0");
            $('#sendCode').html('发送验证码');
        }
    }
</script>
</body>
</html>

